//
//  AppDelegate.m
//  Wo_0820
//
//  Created by 闫潇 on 14-8-20.
//  Copyright (c) 2014年 xian. All rights reserved.
//

#import "AppDelegate.h"
//@interface AppDelegate()
//{
//    NSMutableArray* _number;
//}
//@end
@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    
//    _number = [NSMutableArray array];
    //初始化颜色数组
    NSArray * arr = @[
                      @"(",@")",@"±",@"=",
                      @"1",@"2",@"3",@"+",
                      @"4",@"5",@"6",@"-",
                      @"7",@"8",@"9",@"*",
                      @".",@"0",@"C",@"/",
                      ];
    NSLog(@"%@",arr);
    UILabel * label = [[UILabel alloc]initWithFrame:CGRectMake(5, 20, 310, 60)];
    [label setBackgroundColor:[UIColor lightGrayColor]];
    [label setText:@"闫潇御用、盗版必究！"];
    [label setFont:[UIFont systemFontOfSize:30]];
    [label setTextAlignment:NSTextAlignmentRight];
    [self.window addSubview:label];
    
    static int j;
    for (int i = 0; i<5; i++)
    {
        for (int k=0; k<4; k++)
        {
            UIButton * b = [[UIButton alloc]initWithFrame:CGRectMake(5+80*k,85+80*i,70,70)];
            [b setBackgroundColor:[UIColor colorWithRed:arc4random()%266/255.0 green:arc4random()%266/255.0 blue:arc4random()%266/255.0 alpha:1]];
            [b setTitle:arr[j] forState:UIControlStateNormal];
            [b setTitleColor:[UIColor lightTextColor] forState:UIControlStateHighlighted ];
            CALayer *c = [b layer];
            [c setMasksToBounds:YES];
            [c setCornerRadius:20];
            j++;
            [self.window addSubview:b];
        }
    }
//    for (int i = 0; i<20; i++) {
//        UIView * v = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 200-i*20, 200-i*20)];
//        [v setCenter:CGPointMake(160, 240)];
//        [v setBackgroundColor:arr[i]];
//        [_number addObject:v];
//        [self.window addSubview:v];
//    }
    
    return YES;
}



@end
